package com.myl.core.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.myl.core.basic.BaseEntity;

import java.io.Serial;
import java.io.Serializable;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * <p>
 * 后台角色表
 * </p>
 *
 * @author Myl <ixiaomu@qq.com>
 * @since 2024-01-10 11:21
 */
@Data
@Accessors(chain = true)
@TableName("myl_sys_role")
@Schema(name = "角色", description = "后台角色表")
public class SysRole extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    @NotBlank(message = "名称不能为空")
    @Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符")
    @Schema(description = "名称")
    @TableField("name")
    private String name;

    @NotBlank(message = "标识不能为空")
    @Size(min = 0, max = 30, message = "标识长度不能超过30个字符")
    @Schema(description = "标识")
    @TableField("alias")
    private String alias;

    @Schema(description = "描述")
    @TableField("description")
    private String description;

    @Schema(description = "权限集合")
    @TableField("rules")
    private String rules;
}
